package pkg

import (
	"fmt"
	"github.com/Baidu-AIP/golang-sdk/aip/censor"
	"github.com/goccy/go-json"
)

func Baidu(res string) bool {
	client := censor.NewClient("o835WXQSFVy7KOmsAFSaLUIC", "oldv7Ka8xgEFFJnf7ZiE7FXA7ojbWyPv")
	res = client.TextCensor(res)
	fmt.Println(res)
	resData := map[string]interface{}{}
	json.Unmarshal([]byte(res), resData)
	if resData["conclusion"] == "不合规" {
		return false
	}
	return true
}
